import { ref, onMounted } from 'vue'
import router from '@/router'

//历史上搜索栏

export function useNearbySearch1() {
    const value = ref('');
    const onSearch = (val) => showToast(val);
    const onClickButton = () => showToast(value.value);
    const goTo = () => { router.go(-1) }
    return {
        value,
        onSearch,
        onClickButton,
        goTo
    }
}
//历史下记录栏
export function useNearbySearch2() {
    const Texts = ref([
        "高新区", "高新区文体店", "高新区科技东城", "虎丘区", "通安镇", "高新区文体中心",
    ])
    return {
        Texts
    }
}

export function useNearbyTop() {
    const item = ref();
    const value = ref(0);
    const options = [
        { text: '通安镇', value: 0 },
        { text: '高新区', value: 1 },
        { text: '虎丘区', value: 2 },
        { text: '科技城', value: 3 },
        { text: '高新区文体中心', value: 4 },
    ];


    return {
        value,
        options,

    }
}
export function useNearbyMap() {
    let aMap = ref(null)
    onMounted(() => {
        aMap = new AMap.Map("container", {
            resizeEnable: true,
            zoom: 12 //地图显示的缩放级别
        });
    })
    return {
        aMap,
        onMounted
    }
}